import { request, METHOD } from '@/utils/request';
import qs from 'qs';
// 获取用户列表
export const getListUserApi = (params) => {
  return request(`/rbac/rbacUser/listUser?${qs.stringify(params, { arrayFormat: 'repeat' })}`, METHOD.POST);
};

// 获取所有角色
export const getRoleAllApi = () => {
  return request('/rbac/rbacUserRoleRelation/getRoleAll', METHOD.GET);
};

// 用户分配角色
export const addUserRoleRelationApi = (params) => {
  return request('/rbac/rbacUserRoleRelation/addUserRoleRelation', METHOD.POST, params);
};

// 获取用户拥有的角色
export const getRoleByUserIdApi = ({ userId }) => {
  return request(`/rbac/rbacUserRoleRelation/getRoleByUserId?userId=${userId}`, METHOD.POST);
};
// 所有机队
export const ftmFleetFindAllApi = () => {
  return request('/ftm/ftmFleet/findAll', METHOD.GET);
};

// 根据机队查飞机
export const findListByFleetApi = (params) => {
  return request('/ftm/ftmAirplane/findListByFleet', METHOD.GET, params);
};
/** ******************** */
// 获取事件管控状态列表

export const getEventControlList = (params) => {
  return request('/ftm/ftmType/queryList', METHOD.GET);
};

export const addEventControl = (params) => {
  return request('/ftm/ftmType/saveFtmType', METHOD.POST, params);
};
export const editEventControl = (params) => {
  return request('/ftm/ftmType/updateFtmType', METHOD.POST, params);
};
export const delEventControl = (params) => {
  return request('/ftm/ftmType/removeFtmType', METHOD.POST, params);
};

